package com.hairline.controller;

import com.hairline.bean.vo.BaseRespVo;
import com.hairline.bean.vo.WxCatalogCurrentVo;
import com.hairline.bean.vo.WxCatalogIndexVo;
import com.hairline.service.WxCatalogService;
import com.sun.org.apache.xml.internal.resolver.Catalog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by fenglin on 2020/9/4 11:30 AM
 */
@RestController
@RequestMapping("wx/catalog")
public class WxCatalogController {

    @Autowired
    WxCatalogService wxCatalogService;


    @GetMapping("index")
    public BaseRespVo catalogIndex(){
        WxCatalogIndexVo wxCatalogIndexVo = wxCatalogService.catalogIndex();
        return BaseRespVo.ok(wxCatalogIndexVo);
    }


    @GetMapping("current")
    public BaseRespVo catalogCurrent(Integer id){
        WxCatalogCurrentVo wxCatalogCurrentVo = wxCatalogService.catalogCurrent(id);
        return BaseRespVo.ok(wxCatalogCurrentVo);
    }

}
